AESend

Err:=AESend(Target;Class;ID;Message)

Sends any AppleEvent with a single direct object of type TEXT. The event is sent asynchronously and 4D doesn’t wait for a reply. If you need to wait for a reply, use SendWithReply instead. Note that the AppleEvent manager can coerce a string which represents a number into any numeric format at the receiving end.

Example:
_________________________________________________________________
$err:=MakeAddress("WILD";$hc)if ($err = 0)

$err:=AESend($hc;"misc";"dosc";"go to next card")

$err:=DisposeAddress($hc)
end if ` this is really the same as 'DoScript'
_________________________________________________________________

AESendPict

Err:=AESendPict(target;class;id;aPicture)

Sends an AppleEvent with a picture as the direct object. This is most useful for sending pictures between 4D® databases, as pictures will be sent in 4D’s internal format. If you need to send a picture to an application other than 4D, use the low level function PutPicParam. NOTE: The maximum size of all data in an Apple-Event is 64K unless you have AppleScript installed, so extremely large pictures shouldn't be sent this way.

Example:
_________________________________________________________________
$err:=AESendPict(remoteDB;”DEMO”;”PICT”;aPicture)
if ($err#0)

Alert(“Error sending picture:”+string($err))
end if
_________________________________________________________________

SendWithReply

Err:=SendWithReply(Target;Class;ID;message;reply)

Sends any AppleEvent with a single direct object of type TEXT and returns the direct object of the reply as text. If an error occurs, it will return the 'errs' (error string) parameter instead. If no reply or error message was available, the reply will be an empty string. This is not intended to be used for sending custom events to other 4D (pre-3.0.3) databases, since System 7 Pack handles events asynchronously and doesn’t return a reply with any meaningful information. This can be used, however, to send one of System 7 Pack’s pre-defined events which extract information from 4D.

This command can also be used to force 4D to wait until the other application finishes processing an AppleEvent before it proceeds. Instead of using DoScript you can use SendWithReply(target ; ”misc”;”dosc”;”some commands”;reply) and simply ignore the reply.